package com.mnc.entity;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
@Entity
public class ArticleType implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1221826470703788189L;
	//主键id
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int typeId;
	//类型名称
	@Column
	private String typeName;
	//关联文章
	@OneToMany(mappedBy="articleType",cascade={CascadeType.REFRESH},fetch=FetchType.LAZY)
	private Set<Article> articles=new HashSet<Article>();
	
	public int getTypeId() {
		return typeId;
	}
	public void setTypeId(int typeId) {
		this.typeId = typeId;
	}
	public String getTypeName() {
		return typeName;
	}
	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}
	public Set<Article> getArticles() {
		return articles;
	}
	public void setArticles(Set<Article> articles) {
		this.articles = articles;
	}
	
}
